3.20 \(\int (a+b \sin (c+d x^2))^2 \, dx\)

Optimal. Leaf size=153 \[ \frac{1}{2} x \left (2 a^2+b^2\right )+\frac{\sqrt{2 \pi } a b \sin (c) \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} \sqrt{d} x\right )}{\sqrt{d}}+\frac{\sqrt{2 \pi } a b \cos (c) S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )}{\sqrt{d}}-\frac{\sqrt{\pi } b^2 \cos (2 c) \text{FresnelC}\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )}{4 \sqrt{d}}+\frac{\sqrt{\pi } b^2 \sin (2 c) S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )}{4 \sqrt{d}} \]

[Out]

((2*a^2 + b^2)*x)/2 - (b^2*Sqrt[Pi]*Cos[2*c]*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]])/(4*Sqrt[d]) + (a*b*Sqrt[2*Pi]*C
os[c]*FresnelS[Sqrt[d]*Sqrt[2/Pi]*x])/Sqrt[d] + (a*b*Sqrt[2*Pi]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c])/Sqrt[d]
 + (b^2*Sqrt[Pi]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c])/(4*Sqrt[d])

________________________________________________________________________________________

Rubi [A]  time = 0.109163, antiderivative size = 153, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 5, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.357, Rules used = {3357, 3354, 3352, 3351, 3353} \[ \frac{1}{2} x \left (2 a^2+b^2\right )+\frac{\sqrt{2 \pi } a b \sin (c) \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} \sqrt{d} x\right )}{\sqrt{d}}+\frac{\sqrt{2 \pi } a b \cos (c) S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )}{\sqrt{d}}-\frac{\sqrt{\pi } b^2 \cos (2 c) \text{FresnelC}\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )}{4 \sqrt{d}}+\frac{\sqrt{\pi } b^2 \sin (2 c) S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )}{4 \sqrt{d}} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[c + d*x^2])^2,x]

[Out]

((2*a^2 + b^2)*x)/2 - (b^2*Sqrt[Pi]*Cos[2*c]*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]])/(4*Sqrt[d]) + (a*b*Sqrt[2*Pi]*C
os[c]*FresnelS[Sqrt[d]*Sqrt[2/Pi]*x])/Sqrt[d] + (a*b*Sqrt[2*Pi]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c])/Sqrt[d]
 + (b^2*Sqrt[Pi]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c])/(4*Sqrt[d])

Rule 3357

Int[((a_.) + (b_.)*Sin[(c_.) + (d_.)*((e_.) + (f_.)*(x_))^(n_)])^(p_), x_Symbol] :> Int[ExpandTrigReduce[(a +
b*Sin[c + d*(e + f*x)^n])^p, x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IGtQ[p, 1] && IGtQ[n, 1]

Rule 3354

Int[Cos[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Cos[c], Int[Cos[d*(e + f*x)^2], x], x] - Dist[
Sin[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rule 3352

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3351

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelS[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3353

Int[Sin[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Sin[c], Int[Cos[d*(e + f*x)^2], x], x] + Dist[
Cos[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rubi steps

\begin{align*} \int \left (a+b \sin \left (c+d x^2\right )\right )^2 \, dx &=\int \left (a^2+\frac{b^2}{2}-\frac{1}{2} b^2 \cos \left (2 c+2 d x^2\right )+2 a b \sin \left (c+d x^2\right )\right ) \, dx\\ &=\frac{1}{2} \left (2 a^2+b^2\right ) x+(2 a b) \int \sin \left (c+d x^2\right ) \, dx-\frac{1}{2} b^2 \int \cos \left (2 c+2 d x^2\right ) \, dx\\ &=\frac{1}{2} \left (2 a^2+b^2\right ) x+(2 a b \cos (c)) \int \sin \left (d x^2\right ) \, dx-\frac{1}{2} \left (b^2 \cos (2 c)\right ) \int \cos \left (2 d x^2\right ) \, dx+(2 a b \sin (c)) \int \cos \left (d x^2\right ) \, dx+\frac{1}{2} \left (b^2 \sin (2 c)\right ) \int \sin \left (2 d x^2\right ) \, dx\\ &=\frac{1}{2} \left (2 a^2+b^2\right ) x-\frac{b^2 \sqrt{\pi } \cos (2 c) C\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )}{4 \sqrt{d}}+\frac{a b \sqrt{2 \pi } \cos (c) S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )}{\sqrt{d}}+\frac{a b \sqrt{2 \pi } C\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right ) \sin (c)}{\sqrt{d}}+\frac{b^2 \sqrt{\pi } S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right ) \sin (2 c)}{4 \sqrt{d}}\\ \end{align*}

Mathematica [A]  time = 0.323231, size = 147, normalized size = 0.96 \[ \frac{4 a^2 \sqrt{d} x+4 \sqrt{2 \pi } a b \sin (c) \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} \sqrt{d} x\right )+4 \sqrt{2 \pi } a b \cos (c) S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )-\sqrt{\pi } b^2 \cos (2 c) \text{FresnelC}\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+\sqrt{\pi } b^2 \sin (2 c) S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+2 b^2 \sqrt{d} x}{4 \sqrt{d}} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[c + d*x^2])^2,x]

[Out]

(4*a^2*Sqrt[d]*x + 2*b^2*Sqrt[d]*x - b^2*Sqrt[Pi]*Cos[2*c]*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]] + 4*a*b*Sqrt[2*Pi]
*Cos[c]*FresnelS[Sqrt[d]*Sqrt[2/Pi]*x] + 4*a*b*Sqrt[2*Pi]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c] + b^2*Sqrt[Pi]
*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c])/(4*Sqrt[d])

________________________________________________________________________________________

Maple [A]  time = 0.015, size = 99, normalized size = 0.7 \begin{align*}{a}^{2}x+{\frac{{b}^{2}x}{2}}-{\frac{{b}^{2}\sqrt{\pi }}{4} \left ( \cos \left ( 2\,c \right ){\it FresnelC} \left ( 2\,{\frac{x\sqrt{d}}{\sqrt{\pi }}} \right ) -\sin \left ( 2\,c \right ){\it FresnelS} \left ( 2\,{\frac{x\sqrt{d}}{\sqrt{\pi }}} \right ) \right ){\frac{1}{\sqrt{d}}}}+{ab\sqrt{2}\sqrt{\pi } \left ( \cos \left ( c \right ){\it FresnelS} \left ({\frac{x\sqrt{2}}{\sqrt{\pi }}\sqrt{d}} \right ) +\sin \left ( c \right ){\it FresnelC} \left ({\frac{x\sqrt{2}}{\sqrt{\pi }}\sqrt{d}} \right ) \right ){\frac{1}{\sqrt{d}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(d*x^2+c))^2,x)

[Out]

a^2*x+1/2*b^2*x-1/4*b^2*Pi^(1/2)/d^(1/2)*(cos(2*c)*FresnelC(2*x*d^(1/2)/Pi^(1/2))-sin(2*c)*FresnelS(2*x*d^(1/2
)/Pi^(1/2)))+a*b*2^(1/2)*Pi^(1/2)/d^(1/2)*(cos(c)*FresnelS(x*d^(1/2)*2^(1/2)/Pi^(1/2))+sin(c)*FresnelC(x*d^(1/
2)*2^(1/2)/Pi^(1/2)))

________________________________________________________________________________________

Maxima [C]  time = 1.78175, size = 660, normalized size = 4.31 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2,x, algorithm="maxima")

[Out]

a^2*x - 1/4*sqrt(pi)*(((-I*cos(1/4*pi + 1/2*arctan2(0, d)) - I*cos(-1/4*pi + 1/2*arctan2(0, d)) - sin(1/4*pi +
 1/2*arctan2(0, d)) + sin(-1/4*pi + 1/2*arctan2(0, d)))*cos(c) - (cos(1/4*pi + 1/2*arctan2(0, d)) + cos(-1/4*p
i + 1/2*arctan2(0, d)) - I*sin(1/4*pi + 1/2*arctan2(0, d)) + I*sin(-1/4*pi + 1/2*arctan2(0, d)))*sin(c))*erf(s
qrt(I*d)*x) + ((I*cos(1/4*pi + 1/2*arctan2(0, d)) + I*cos(-1/4*pi + 1/2*arctan2(0, d)) - sin(1/4*pi + 1/2*arct
an2(0, d)) + sin(-1/4*pi + 1/2*arctan2(0, d)))*cos(c) - (cos(1/4*pi + 1/2*arctan2(0, d)) + cos(-1/4*pi + 1/2*a
rctan2(0, d)) + I*sin(1/4*pi + 1/2*arctan2(0, d)) - I*sin(-1/4*pi + 1/2*arctan2(0, d)))*sin(c))*erf(sqrt(-I*d)
*x))*a*b/sqrt(abs(d)) - 1/32*(sqrt(2)*sqrt(pi)*(((cos(1/4*pi + 1/2*arctan2(0, d)) + cos(-1/4*pi + 1/2*arctan2(
0, d)) - I*sin(1/4*pi + 1/2*arctan2(0, d)) + I*sin(-1/4*pi + 1/2*arctan2(0, d)))*cos(2*c) - (I*cos(1/4*pi + 1/
2*arctan2(0, d)) + I*cos(-1/4*pi + 1/2*arctan2(0, d)) + sin(1/4*pi + 1/2*arctan2(0, d)) - sin(-1/4*pi + 1/2*ar
ctan2(0, d)))*sin(2*c))*erf(sqrt(2*I*d)*x) + ((cos(1/4*pi + 1/2*arctan2(0, d)) + cos(-1/4*pi + 1/2*arctan2(0,
d)) + I*sin(1/4*pi + 1/2*arctan2(0, d)) - I*sin(-1/4*pi + 1/2*arctan2(0, d)))*cos(2*c) - (-I*cos(1/4*pi + 1/2*
arctan2(0, d)) - I*cos(-1/4*pi + 1/2*arctan2(0, d)) + sin(1/4*pi + 1/2*arctan2(0, d)) - sin(-1/4*pi + 1/2*arct
an2(0, d)))*sin(2*c))*erf(sqrt(-2*I*d)*x))*sqrt(abs(d)) - 16*x*abs(d))*b^2/abs(d)

________________________________________________________________________________________

Fricas [A]  time = 2.02911, size = 385, normalized size = 2.52 \begin{align*} \frac{4 \, \sqrt{2} \pi a b \sqrt{\frac{d}{\pi }} \cos \left (c\right ) \operatorname{S}\left (\sqrt{2} x \sqrt{\frac{d}{\pi }}\right ) + 4 \, \sqrt{2} \pi a b \sqrt{\frac{d}{\pi }} \operatorname{C}\left (\sqrt{2} x \sqrt{\frac{d}{\pi }}\right ) \sin \left (c\right ) - \pi b^{2} \sqrt{\frac{d}{\pi }} \cos \left (2 \, c\right ) \operatorname{C}\left (2 \, x \sqrt{\frac{d}{\pi }}\right ) + \pi b^{2} \sqrt{\frac{d}{\pi }} \operatorname{S}\left (2 \, x \sqrt{\frac{d}{\pi }}\right ) \sin \left (2 \, c\right ) + 2 \,{\left (2 \, a^{2} + b^{2}\right )} d x}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2,x, algorithm="fricas")

[Out]

1/4*(4*sqrt(2)*pi*a*b*sqrt(d/pi)*cos(c)*fresnel_sin(sqrt(2)*x*sqrt(d/pi)) + 4*sqrt(2)*pi*a*b*sqrt(d/pi)*fresne
l_cos(sqrt(2)*x*sqrt(d/pi))*sin(c) - pi*b^2*sqrt(d/pi)*cos(2*c)*fresnel_cos(2*x*sqrt(d/pi)) + pi*b^2*sqrt(d/pi
)*fresnel_sin(2*x*sqrt(d/pi))*sin(2*c) + 2*(2*a^2 + b^2)*d*x)/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sin{\left (c + d x^{2} \right )}\right )^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x**2+c))**2,x)

[Out]

Integral((a + b*sin(c + d*x**2))**2, x)

________________________________________________________________________________________

Giac [C]  time = 1.4476, size = 263, normalized size = 1.72 \begin{align*} \frac{i \, \sqrt{2} \sqrt{\pi } a b \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{2} x{\left (-\frac{i \, d}{{\left | d \right |}} + 1\right )} \sqrt{{\left | d \right |}}\right ) e^{\left (i \, c\right )}}{2 \,{\left (-\frac{i \, d}{{\left | d \right |}} + 1\right )} \sqrt{{\left | d \right |}}} - \frac{i \, \sqrt{2} \sqrt{\pi } a b \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{2} x{\left (\frac{i \, d}{{\left | d \right |}} + 1\right )} \sqrt{{\left | d \right |}}\right ) e^{\left (-i \, c\right )}}{2 \,{\left (\frac{i \, d}{{\left | d \right |}} + 1\right )} \sqrt{{\left | d \right |}}} + \frac{\sqrt{\pi } b^{2} \operatorname{erf}\left (-\sqrt{d} x{\left (-\frac{i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (2 i \, c\right )}}{8 \, \sqrt{d}{\left (-\frac{i \, d}{{\left | d \right |}} + 1\right )}} + \frac{\sqrt{\pi } b^{2} \operatorname{erf}\left (-\sqrt{d} x{\left (\frac{i \, d}{{\left | d \right |}} + 1\right )}\right ) e^{\left (-2 i \, c\right )}}{8 \, \sqrt{d}{\left (\frac{i \, d}{{\left | d \right |}} + 1\right )}} + \frac{1}{2} \,{\left (2 \, a^{2} + b^{2}\right )} x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2,x, algorithm="giac")

[Out]

1/2*I*sqrt(2)*sqrt(pi)*a*b*erf(-1/2*sqrt(2)*x*(-I*d/abs(d) + 1)*sqrt(abs(d)))*e^(I*c)/((-I*d/abs(d) + 1)*sqrt(
abs(d))) - 1/2*I*sqrt(2)*sqrt(pi)*a*b*erf(-1/2*sqrt(2)*x*(I*d/abs(d) + 1)*sqrt(abs(d)))*e^(-I*c)/((I*d/abs(d)
+ 1)*sqrt(abs(d))) + 1/8*sqrt(pi)*b^2*erf(-sqrt(d)*x*(-I*d/abs(d) + 1))*e^(2*I*c)/(sqrt(d)*(-I*d/abs(d) + 1))
+ 1/8*sqrt(pi)*b^2*erf(-sqrt(d)*x*(I*d/abs(d) + 1))*e^(-2*I*c)/(sqrt(d)*(I*d/abs(d) + 1)) + 1/2*(2*a^2 + b^2)*
x